﻿//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------

using UnityEditor;
using UnityEngine;

namespace Local.Editor
{
    [CustomEditor(typeof(HotUpdateComponent))]
    internal sealed class HotUpdateComponentInspector : UnityEditor.Editor
    {
        SerializedProperty m_DLLAssetsInfoAssetName = null;
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            serializedObject.Update();            
            EditorGUI.BeginChangeCheck();
            m_DLLAssetsInfoAssetName.stringValue = DLLsSaveInfoSetting.DEFAULT_ASSET_NAME;                       
            GUILayout.Label($"DLLs信息资源名称：{DLLsSaveInfoSetting.DEFAULT_ASSET_NAME}");
            GUILayout.Label($"DLLs保存位置：{DLLsSaveInfoSetting.DEFAULT_PATH}");
            GUILayout.Label("请先使用热更工具拷贝文件");                        
            if (EditorGUI.EndChangeCheck() || GUILayout.Button("保存"))
            {
                serializedObject.ApplyModifiedProperties();
            }
        }
        private void OnEnable()
        {
            m_DLLAssetsInfoAssetName = serializedObject.FindProperty("m_DLLAssetsInfoAssetName");
        }
    }
}
